package beans;
import java.sql.*;
public class dbu {
	private Connection con=null;
	private PreparedStatement pstm=null;
	public ResultSet rs=null;
	public int updateSQL(String sql){
		int n=-1;
		try{
			con=dbc.getDBconnection();
			pstm=con.prepareStatement(sql);
			n=pstm.executeUpdate();
			
		}catch(SQLException e){e.printStackTrace();}
		dbc.closeDB(con, pstm, rs);
		return n;
	}
	public ResultSet QuerySQL(String sql){
		try{
			con=dbc.getDBconnection();
			pstm=con.prepareStatement(sql);
			rs=pstm.executeQuery();
			return rs;
		}catch(SQLException e){e.printStackTrace();}
		return null;
	}
	

}
